home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 1 / QRZ Ham Radio Callsign Database - December 1993.iso / ucsd / drivers.arc / DEFS.ASM < prev    next >
Encoding:
Assembly Source File  |  1988-09-02  |  2.6 KB  |  72 lines

  1. ;/* PC/FTP Packet Driver source, conforming to version 1.05 of the spec
  2. ;*  Russell Nelson, Clarkson University.  July 20, 1988
  3. ;*  Portions (C) Copyright 1988 Russell Nelson
  4. ;*
  5. ;*  Permission is granted to any individual or institution to use, copy,
  6. ;*  modify, or redistribute this software and its documentation provided
  7. ;*  this notice and the copyright notices are retained.  This software may
  8. ;*  not be distributed for profit, either in original form or in derivative
  9. ;*  works.  Russell Nelson makes no representations about the suitability
  10. ;*  of this software for any purpose.  RUSSELL NELSON GIVES NO WARRANTY,
  11. ;*  EITHER EXPRESS OR IMPLIED, FOR THE PROGRAM AND/OR DOCUMENTATION
  12. ;*  PROVIDED, INCLUDING, WITHOUT LIMITATION, WARRANTY OF MERCHANTABILITY
  13. ;*  AND WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE.
  14. ;*/
  15.  
  16.     .286
  17.  
  18. HT    equ    09h
  19. CR    equ    0dh
  20. LF    equ    0ah
  21.  
  22. ;
  23. ;  Packet Driver Error numbers
  24. BAD_HANDLE    equ    1        ;invalid handle number
  25. NO_CLASS    equ    2        ;no interfaces of specified class found
  26. NO_TYPE        equ    3        ;no interfaces of specified type found
  27. NO_NUMBER    equ    4        ;no interfaces of specified number found
  28. BAD_TYPE    equ    5        ;bad packet type specified
  29. NO_MULTICAST    equ    6        ;this interface does not support
  30. CANT_TERMINATE    equ    7        ;this packet driver cannot terminate
  31. BAD_MODE    equ    8        ;an invalid receiver mode was specified
  32. NO_SPACE    equ    9        ;operation failed because of insufficient
  33. TYPE_INUSE    equ    10        ;the type had previously been accessed,
  34. BAD_COMMAND    equ    11        ;the command was out of range, or not
  35. CANT_SEND    equ    12        ;the packet couldn't be sent (usually
  36.  
  37.  
  38. RUNT        equ    60        ;smallest legal size packet, no fcs
  39. GIANT        equ    1514        ;largest legal size packet, no fcs
  40.  
  41. EADDR_LEN    equ    6        ;Ethernet address length.
  42.  
  43. ;The following two macros are used to manipulate port addresses.
  44. ;Use loadport to initialize dx.  Use setport to set a specific port on
  45. ;the board.  setport remembers what the current port number is, but beware!
  46. ;setport assumes that code is being executed in the same order as the
  47. ;code is presented in the source file.  Whenever this assumption is violated,
  48. ;you need to enter another loadport.
  49. loadport    macro
  50.     mov    dx,io_addr
  51. port_no    =    0
  52.     endm
  53.  
  54. ;change the port number from the current value to the new value.
  55. setport    macro    new_port_no
  56.     ifdef    no_confidence        ;define if you suspect that you don't
  57.         loadport        ;  have enough loadports, i.e. dx is
  58.     endif                ;  set to the wrong port.
  59.     if    new_port_no - port_no EQ 1
  60.         inc    dx
  61.     else
  62.         if    new_port_no - port_no EQ -1
  63.             dec    dx
  64.         else
  65.             if    new_port_no - port_no NE 0
  66.                 add    dx,new_port_no - port_no
  67.             endif
  68.         endif
  69.     endif
  70. port_no    =    new_port_no
  71.     endm
  72.